<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改售后反馈')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-erpAfterFeedback-edit" th:object="${erpAfterFeedback}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">来源渠道：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('erp_channel')}">
                        <input type="radio" th:id="${'channel_' + dict.dictCode}" name="channel" th:value="${dict.dictValue}" th:field="*{channel}" required>
                        <label th:for="${'channel_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">订单号：</label>
                <div class="col-sm-8">
                    <input name="orderNo" readonly th:field="*{orderNo}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">客户编号：</label>
                <div class="col-sm-8">
                    <input name="customerNo" readonly th:field="*{customerNo}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">生产型号：</label>
                <div class="col-sm-8">
                    <input name="modeNo" readonly th:field="*{modeNo}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">反馈问题：</label>
                <div class="col-sm-8">
                    <textarea name="issueText" class="form-control" required>[[*{issueText}]]</textarea>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">联系人：</label>
                <div class="col-sm-8">
                    <input name="contacts" th:field="*{contacts}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">联系电话：</label>
                <div class="col-sm-8">
                    <input name="contactsPhone" th:field="*{contactsPhone}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">联系地址：</label>
                <div class="col-sm-8">
                    <input name="contactsAddress" th:field="*{contactsAddress}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">售后状态：</label>
                <div class="col-sm-8">
                    <select name="state" class="form-control m-b" th:with="type=${@dict.getType('erp_aftersale_state')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{state}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <textarea name="remark" class="form-control">[[*{remark}]]</textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        // 详情禁用所有input
        $(":input").attr("disabled", "disabled");

        var prefix = ctx + "erp/erpAfterFeedback";
        $("#form-erpAfterFeedback-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-erpAfterFeedback-edit').serialize());
            }
        }
    </script>
</body>
</html>